import request from '@/common/request'
import requestPlat from '@/common/requestPlat'
import Qs from 'qs';
// 获取我的
export let getUserHome = (data) => {
	return requestPlat({
		method: 'get',
		url: 'member/user/home',
	})
}
// 更新信息
export let userUpdate = (data) => {
	return requestPlat({
		method: 'post',
		url: 'member/user/update',
		// headers: {
		// 	"Content-Type": 'application/json'
		// },
		data:Qs.stringify(data)
	})
}
// 我的勋章列表
export let getUserMedal = (params) => {
	return requestPlat({
		method: 'get',
		url: 'user/user/medal/list',
		params
	})
}
// 表现列表
export let pagePerform = (params) => {
	return requestPlat({
		method: 'get',
		url: `user/user/perform/page/${params.page}/${params.limit}`,
		params
	})
}
// 我的奖励
export let getUserBonus = (params) => {
	return requestPlat({
		method: 'get',
		url: `user/user/bonus/page/${params.page}/${params.limit}`,
		params
	})
}
// 我的员工明细
export let getUserStaff = (params) => {
	return requestPlat({
		method: 'get',
		url: 'user/user/detail',
		params
	})
}
// 修改手机号
export let editPhone = (data) => {
	return requestPlat({
		method: 'post',
		url: `member/user/telphone?telphone=${data.telphone}&code=${data.code}`,
	})
}
// 提现记录
export let getWithdrawal = (params) => {
	return requestPlat({
		method: 'get',
		url: `user/withdraw/page/${params.page}/${params.limit}?type=${params.type}`,
	})
}
// 收藏列表
export let collectList = (params) => {
	return requestPlat({
		method: 'get',
		url: `product/user/collect/page/${params.page}/${params.limit}`,
	})
}
// 收藏操作
export let collectChange = (data) => {
	return requestPlat({
		method: 'post',
		url: `product/user/collect/collect?mchId=${data.mchId}&companyId=${data.companyId}&operateId=${data.operateId}&bizId=${data.bizId}&spuId=${data.spuId}`,
	})
}



// 修改密码
export function updatePass(data) {
    return requestPlat({
        url: `member/user/pass`,
        method: 'post',
        data: Qs.stringify(data)
    })
}

// 找回密码
export function findPass(data) {
    return requestPlat({
        url: `member/data/login/find`,
        method: 'post',
        data: Qs.stringify(data)
    })
}


// 获取订单数量
export function orderCountList(data) {
    return request({
        url: `order/user/order/count`,
        method: 'post',
        // data: Qs.stringify(data)
    })
}
// 获取员工列表
export function pageStaff(params) {
    return requestPlat({
        url: `member/user/page/${params.page}/${params.limit}`,
        method: 'get',
		params
    })
}
// 发放员工奖励
export let addStaff = (data) => {
	return requestPlat({
		method: 'post',
		url: `member/user/bonus?title=${data.title}&integral=${data.integral}&bonus=${data.bonus}&userId=${data.userId}`,
		// headers: {
		// 	"Content-Type": 'application/json'
		// },
		// data:Qs.stringify(data) 
	})
}

// 获取企业详情
export let detailCompany = (params) => {
	return requestPlat({
		method: 'get',
		url: 'tenant/data/company/detail',
		params
	})
}





